<%@ page language="java" pageEncoding="utf8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>机器信息列表</title>
		<link href="tablecloth/tablecloth.css" rel="stylesheet"
			type="text/css" media="screen" />
		<script type="text/javascript" src="tablecloth/tablecloth.js"></script>
		<script type="text/javascript" src="js/splitpage.js"></script>
		<link href="css/splitpage.css" rel="stylesheet"
			type="text/css" media="screen" />
		<style type="text/css">
#thisform {
	font-family: Georgia, serif;
	font-size: 12px;
	color: #999;
}

#thisform label {
	font-family: Verdana, sans-serif;
	font-weight: bold;
	color: #660000;
}
		
<!--
.STYLE1 {
	font-family: "宋体";
	font-size: small;
	color: #999999;
}

.STYLE2 {
	font-size: small
}
.STYLE3 {
	font-family: "宋体";
	font-size: small;
	color: #FF0000;
}
-->
</style>
	</head>
	<body>
		<div align="center">
			<img src="image/temp.jpg" alt="首页" width="100%" height="70"
				align="middle">
		</div>
		<c:if test="${map.msg!=null}"><c:out value="${map.msg}"/></c:if>
		<table width="100%" border="0">
          <tr>
            <td width="20%"><span class="STYLE1">当前位置—<a href="redirect.do?method=welcome">首页</a>—机器列表</span></td>
            <form action="mgrmachine.do?method=mgrMachineList" method="post">
            <td width="50%" valign="middle">
	            <span><div align="center" class="STYLE3">
	            	<input type="text" id="ip" name="ip"/>&nbsp;<input type="submit" value="IP查询"/>
	            </div>
	            </span>
            </td>
            </form>
            <td width="20%"><div align="right" class="STYLE2">
			<a href="redirect.do?method=addmachine">添加</a>&nbsp;<a href="redirect.do?method=welcome">首页</a>&nbsp;<a href="logout.do">退出 </a>
		</div></td>
          </tr>
        </table>
		<table cellspacing="0" cellpadding="0">
			<tr>
				<th>
					IP
				</th>
				<th >
					机房
				</th>
				<th >
					机柜
				</th>
				<th >
					机器品牌
				</th>
				<th >
					内存
				</th>
				<th>
					CPU
				</th>
				<th >
					存储结构
				</th>
				<th>
					磁盘
				</th>
				<th>
					数据库
				</th>
				<th>
					Edit
				</th>
			</tr>
			<c:forEach var="machine" items="${map.dtoList}">
				<tr>
					<td>
						<a href="mgrdatabase.do?method=mgrDatabaseList&machineId=${machine.id}" title="<c:out value='${machine.hostName}'/>"><c:out value="${machine.ip}" /></a>
					</td>
					<td>
						<c:out value="${machine.machineRoom}" />
					</td>
					<td>
						<c:out value="${machine.machineLocation}" />
					</td>
					<td>
						<c:out value="${machine.machineBrand}" />
					</td>
					<td>
						<c:out value="${machine.machineRam}" />
					</td>
					<td>
						<c:out value="${machine.cpuInfo}" />
					</td>
					<td>
						<c:out value="${machine.storageStructure}" />
					</td>
					<td>
						<c:out value="${machine.discInfo}" />
					</td>
					<td>
						<c:out value="${machine.mountDiscInfo}" />
					</td>
					<td>
						<img align="middle" title="编辑" src="image/btn_edit.jpg" onclick="window.location.href='mgrmachine.do?method=editMachine&machineId=${machine.id}'" style="cursor:pointer">
                        <img align="middle" title="添加数据库" disabled src="image/btn_sticky.jpg" onclick="window.location.href='redirect.do?method=adddatabase&machineId=${machine.id}'" style="cursor:pointer">
						<img align="middle" title="删除" src="image/btn_delete.jpg" onclick="window.location.href='mgrmachine.do?method=deleteMgrMachine&machineId=${machine.id}&index=${map.index}'" style="cursor:pointer">
						<img align="middle" title="禁用" src="image/btn_lock.jpg" onclick="window.location.href='mgrmachine.do?method=disableMgrMachine&machineId=${machine.id}&index=${map.index}'" style="cursor:pointer">
					</td>
				</tr>
			</c:forEach>
		</table>
		<div id="pager" style="padding-top:10px;padding-bottom:10px;background-color:#328aa4;"></div>
		<script type="text/javascript">
			var pager = new PagerView('pager');
			pager.itemCount = "${map.totalCount}";
			pager.size = "${map.limit}";
			pager.index = "${map.index}";
			var ip="${map.ip}"
			pager.onclick = function(index){
				window.location.href = "mgrmachine.do?method=mgrMachineList&index="+index+"&ip="+ip;
			};
			pager.render();
		</script>
		<script type="text/javascript">
			
		</script>
	</body>
</html>
